#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int a[200005];
int bo[200005];
int cnt=1,n;
int h[200005],s[200005],k[200005];
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	int now=1;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	h[1]=1;
	s[1]=1;
	k[1]=a[1];
	for(int i=2;i<=n;i++){
		if(a[i]!=a[now]){
			cnt++;
			h[cnt]=i;
			s[cnt]=1;
			k[cnt]=a[i];
			now=i;
		}else{
			s[cnt]++;
		}
	}
	while(1){
		memset(bo,0,sizeof(bo));
		bool b=1;
		for(int i=1;i<=cnt;i++){
			if(s[i]!=0){
				bool bb=0;
				int j=i;
				while(j--){
					if(s[j]>=1){
						if(k[i]==k[j]){
							bb=1;
						}
						break;
					}
				}
				b=0;
				if(bb==0){
					bo[i]=1;
					printf("%d ",h[i]); 
					//cout<<h[i]<<' ';
				}
			}
		}
		for(int i=1;i<=cnt;i++){
			if(bo[i]){
				s[i]--;
				h[i]++;
			}
		}
		if(b==1){
			break;
		}
		cout<<endl;
	}
	return 0;
}
